package com.new2i.dao.impl;
  
import java.util.HashMap;
import java.util.List;


import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import com.new2i.dao.able.UserDao;
import com.new2i.dao.mapper.UserMapper;
import com.new2i.model.UserEntity;

/**
 * 用户UserEntity类数据库操作实现类
 * 
 * @since 2015/08/21
 * @author 2i
 *
 */
@Repository("UserDao")
public class UserDaoImpl implements UserDao {

	@Autowired
	private UserMapper userMapper;
	  
	@Override
	public HashMap<String, Object> getUserInfoById (int user_id) {
		return userMapper.getUserInfoById(user_id); 
	}

    @Override
    public List<UserEntity> getUserIdByCity(String city) { 
        return userMapper.getUserIdByCity(city);
    }

	@Override
	public List<HashMap<String, Object>> selectUserInfoByWxid(String wxid, int public_number_source,int source) { 
		return userMapper.selectUserInfoByWxid(wxid, public_number_source,source);
	}

	@Override
	public UserEntity insertUser(UserEntity user) { 
		userMapper.insertUser(user);  
		return user;
	}

	@Override
	public void updateUserEmrNoByUserId(int user_id) {
		userMapper.updateUserEmrNoByUserId(user_id);
	}

	@Override
	public int updateUserInfoByUserId(UserEntity user) {
		return userMapper.updateUserInfoByUserId(user);
	}

}
